package cn.picclife.mwx.manager.sys.quartz.task;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import cn.picclife.mwx.manager.sys.model.bo.CheckQualityRequest;
import cn.picclife.mwx.manager.sys.service.CheckQualityService;

/**
 * 定时任务调度测试
 * 
 * @author
 */
@Component("task")
public class Task {
	
//	@Autowired
//	private ArchiveTask archiveTask;
	private static final Log log = LogFactory.getLog(Task.class);
	@Autowired
	private CheckQualityService checkQualityServiceImpl;
	/**
	 * 质检
	 * @param
	 * @param
	 * @param
	 * @param
	 * @param
	 */
    public void checkQualityParams(String organCode, String percent, String checkStartDate, String checkEndDate, String usercode) {
    	
    	log.info("执行质检方法开始");
//    	archiveTask.archive();
    	CheckQualityRequest req = new CheckQualityRequest();
    	req.setOrganCode(organCode);
    	req.setPercent(percent);
    	/*req.setCheckStartDate(checkStartDate);
    	req.setCheckEndDate(checkEndDate);*/
		req.setStartTime(checkStartDate);
		req.setEndTime(checkEndDate);
    	req.setUser(usercode);
//    	HttpServletRequest request = new HttpServletRequest();
//    	request.getSession().setAttribute("user", "");
    	try {
			checkQualityServiceImpl.getDistributeData(req);
		} catch (Exception e) {
			log.error(e);
		}
        log.info("执行质检方法结束");
    }

    /**
     * 归档
     */
    public void noParams() {
        log.info("执行归档方法开始");
//    	archiveTask.archive();
        log.info("执行归档方法结束");
    }
}
